package micro.web.config;

import micro.web.interceptor.DefaultHttpInterceptor;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author txw
 * @version V1.0
 * @Title: WebConfig
 * @ProjectName micro-email-server
 * @Description: 描述
 * @since 2018/6/21 0:05
 */
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
    @Bean
    public DefaultHttpInterceptor defaultHttpInterceptor() {
        return new DefaultHttpInterceptor();
    }
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(defaultHttpInterceptor())
                .addPathPatterns("/**");

    }
}
